package com.prs.crm.dao.oa.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.oa.PersonTimeDao;
import com.prs.crm.domain.hr.Person;
import com.prs.crm.domain.oa.OaTaskSource;
import com.prs.crm.domain.oa.PersonTime;

public class PersonTimeDaoImpl extends BaseDaoImpl<PersonTime> implements PersonTimeDao{

	@Override
	public PersonTime getPersonTimeByPerson(Person person) {
		Criteria criteria = this.getSession().createCriteria(PersonTime.class);
		criteria.add(Restrictions.eq("recorder", person));
		List<PersonTime> list=criteria.list();
		if(list.size()!=0){
			return list.get(0);
		}else{
			return null;
		}
	}

}
